<%@page import="com.is.model.Student"%>
<%@page import="com.is.control.StudentControl"%>
<%@page import="com.is.util.DesData"%>
<%@page import="com.is.exportword.ExportWord"%>
<%@page import="com.jspsmart.upload.SmartUpload"%>
<%@page import="com.is.util.ParamUtil"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'pic.jsp' starting page</title>
  </head>
  
  <body>
<%
response.reset();
	String stu = ParamUtil.getString(request,"stu");
	DesData des = new DesData();
	int sid =Integer.parseInt(des.decrypt(stu));
	Student s = StudentControl.getStudent(sid);
	String path = request.getRealPath("/");
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
	String fileName = "学生信息文档("+s.getChineseName()+").doc";  
   //对中文文件名编码  
  //fileName = URLEncoder.encode(fileName, "utf-8");  
   byte[] yte = fileName.getBytes("GB2312");  
   String unicoStr = new String(yte, "ISO-8859-1");
	String realPath = path + "\\DownloadXls\\" + unicoStr;
	//String visitPath = basePath + "/DownloadXls/" + fileName;
	//ExportOneClassDetail.ExportOneClassAllAttendance(realPath, request);
	String picBasePath =this.getServletConfig().getServletContext().getRealPath("/");
	String absolutePath = basePath+fileName.replace("/InterStu/", "").replace("/", "\\");
	new ExportWord().createDoc(realPath,sid,picBasePath);

	SmartUpload smartUpload = new SmartUpload();
	smartUpload.initialize(pageContext);
	smartUpload.setContentDisposition(null);
	smartUpload.downloadFile(realPath);
	out.clear();
 	out=pageContext.pushBody();

 %>
  </body>
</html>
